#include "MainWindow.hpp"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent), ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    glWidget = new GLWidget( this );
    setCentralWidget( glWidget );
    connect( ui->actionQuit, SIGNAL(triggered()),
             qApp, SLOT(quit()) );
    connect( ui->actionAboutQt, SIGNAL(triggered()),
             qApp, SLOT(aboutQt()) );
    connect( ui->actionAboutLGPL, SIGNAL(triggered()),
             this, SLOT(aboutLGPL()) );
    connect( ui->actionAboutWORLDGenerator, SIGNAL(triggered()),
            this, SLOT(aboutWorldGen()) );
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::aboutLGPL()
{
    QMessageBox::information( this, "About LGPL",
                              "<a href=\"http://www.gnu.org/licenses/lgpl-3.0.txt\">Click here</a>",
                              QMessageBox::Ok );
}

void MainWindow::aboutWorldGen()
{
    QMessageBox::information( this, "About WORLD Generator",
                              "<a href=\"http://code.google.com/p/world-gen\">Click here</a>",
                              QMessageBox::Ok );
}
